#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
using namespace std;
const int N = 110, M = 1e4 + 10;
int a[N][N];
int f[N][M];
int t, n, m;
int solve(int v[], int w[], int m)
{
    memset(f, 0, sizeof(f));
    for (int i = 1; i <= n; i++)
    {
        for (int j = 0; j <= m; j++)
        {
            f[i][j] = f[i - 1][j];
            if (j >= v[i])
            {
                f[i][j] = max(f[i][j], f[i][j - v[i]] + w[i] - v[i]);
            }
        }
    }
    return m + f[n][m];
}
int main()
{
    cin >> t >> n >> m;
    for (int i = 1; i <= t; i++)
    {
        for (int j = 1; j <= n; j++)
        {
            cin >> a[i][j];
        }
    }
    for (int i = 1; i < t; i++)
    {
        m = solve(a[i], a[i + 1], m);
    }
    cout << m << endl;
    return 0;
}